{% extends "default.html" %}

{% block content %}
<div class="title">
	Ventas del Dia
</div>
<div class="content">
	<div>Seleccione la fecha de la cual quiere el reporte diario</div>
	<form action="/reports/dailysales/" method="post">
	<table class="table_report">
		<tr>
			<th>
				<select name="day">
					<option value="1">1</option>
					<option value="2">2</option>
					<option value="3">3</option>
					<option value="4">4</option>
					<option value="5">5</option>
					<option value="6">6</option>
					<option value="7">7</option>
					<option value="8">8</option>
					<option value="9">9</option>
					<option value="10">10</option>
					<option value="11">11</option>
					<option value="12">12</option>
					<option value="13">13</option>
					<option value="14">14</option>
					<option value="15">15</option>
					<option value="16">16</option>
					<option value="17">17</option>
					<option value="18">18</option>
					<option value="19">19</option>
					<option value="20">20</option>
					<option value="21">21</option>
					<option value="22">22</option>
					<option value="23">23</option>
					<option value="24">24</option>
					<option value="25">25</option>
					<option value="26">26</option>
					<option value="27">27</option>
					<option value="28">28</option>
					<option value="29">29</option>
					<option value="30">30</option>
					<option value="31">31</option>
				</select>
			</th>
			<th>
				<select name="month">
					<option value="1">Enero</option>
					<option value="2">Febrero</option>
					<option value="3">Marzo</option>
					<option value="4">Abril</option>
					<option value="5">Mayo</option>
					<option value="6">Junio</option>
					<option value="7">Julio</option>
					<option value="8">Agosto</option>
					<option value="9">Septiembre</option>
					<option value="10">Octubre</option>
					<option value="11">Noviembre</option>
					<option value="12">Diciembre</option>
				</select>
			</th>
			<th>
				<select name="year">
					<option value="2009">2009</option>
					<option value="2010" selected>2010</option>
					<option value="2011">2011</option>
					<option value="2012">2012</option>
					<option value="2013">2013</option>
					<option value="2014">2014</option>
					<option value="2015">2015</option>
					<option value="2016">2016</option>
					<option value="2017">2017</option>
					<option value="2018">2018</option>
					<option value="2019">2019</option>
					<option value="2020">2020</option>
				</select>
			</th>
			<th><input type="submit" value="Mostrar"></th>
		</tr>
	</table>
	</form>
	<div>Ventas encontradas para la fecha: {{ request.date|date:"d \de F \de Y" }}</div>

	<table class="table_report">
		<tr>
			<th>Hora</th>
			<th>Cliente</th>
			<th>Vendedor</th>
			<th>Tipo</th>
			<th>Factura</th>
			<th>Acciones</th>
		</tr>
		{% for s in request.sales %}
		<tr>
			<td>{{ s.made|date:"H:i"}}</td>
			<td>{{ s.client }}</td>
			<td>{{ s.vendor }}</td>
			<td>
				{% if s.payment_method %}
					Contado
				{% else %}
					Cr&eacute;dito
				{% endif %}
			</td>
			<td>{{ s.bill_number }}</td>
			<td><a href="javascript:show_sale({{ s.id }})">Ver</a></td>
		</tr>
		{% endfor %}
		<tr>
			<th colspan="4">Total d&iacute;a</th>
			<th colspan="2">{{ request.sales_total }} Bs.</th>
		</tr>
	</table>

</div>
{% endblock %}